﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Microsoft.Phone.Controls;

namespace CricketHub
{
    public partial class MainPage : PhoneApplicationPage
    {
        // Constructor
        public MainPage()
        {
            InitializeComponent();
            try
            {
                textBlock1.Text = DateTime.Now.ToShortDateString();
            }
            catch (Exception ds)
            {
 
            }
            this.OrientationChanged += new EventHandler<OrientationChangedEventArgs>(MainPage_OrientationChanged);
        }

        void MainPage_OrientationChanged(object sender, OrientationChangedEventArgs e) 
        {
            if ((e.Orientation & PageOrientation.Landscape) != 0)
            {
              /*  Grid.SetRow(image5, 0);
                Grid.SetColumn(image5, 1);
                Grid.SetRow(textBlock1, 0);
                Grid.SetColumn(textBlock1, 1);

                */
            }
            else
            {
              /*  Grid.SetRow(image5, 1);
                Grid.SetColumn(image5, 0);
                Grid.SetRow(textBlock1, 1);
                Grid.SetColumn(textBlock1, 0); */
            }
        }

        private void image1_Tap(object sender, GestureEventArgs e)
        {
            NavigationService.Navigate(new Uri("/News.xaml",UriKind.RelativeOrAbsolute));
        }

        private void image2_Tap(object sender, GestureEventArgs e)
        {
            NavigationService.Navigate(new Uri("/TeamProfile.xaml", UriKind.RelativeOrAbsolute));
        }

        private void image4_ImageFailed(object sender, ExceptionRoutedEventArgs e)
        {

        }

        private void image4_Tap(object sender, GestureEventArgs e)
        {
            NavigationService.Navigate(new Uri("/Livescore.xaml",UriKind.Relative));
        }

        private void image3_Tap(object sender, GestureEventArgs e)
        {
            NavigationService.Navigate(new Uri("/Schedule.xaml", UriKind.RelativeOrAbsolute));

        }

        private void textBlock1_Tap(object sender, GestureEventArgs e)
        {
            NavigationService.Navigate(new Uri("/Schedule.xaml", UriKind.RelativeOrAbsolute));
        }
       
    }
}